package com.example.zhunongzonghe.controller;

import com.example.zhunongzonghe.beans.SysRegionBean;
import com.example.zhunongzonghe.common.Result;
import com.example.zhunongzonghe.service.ISysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/sysRegion")
public class SysRegionController{
    @Autowired
    private ISysRegionService sysRegionService;

    @GetMapping("/RegionTree")
    public Result<List<SysRegionBean>> getTree(){
        List<SysRegionBean> sysRegions = sysRegionService.getRegionTree();
        return new Result<>(true,"查询成功",200,sysRegions);
    }
}